﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManageMenus.aspx.cs" Inherits="Se7en.Admin.Web.Pages.ManageMenu"
    MasterPageFile="~/Site.master" %>

<%@ Register Src="~/Controls/MenuEdit.ascx" TagPrefix="uc1" TagName="MenuEdit" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:UpdatePanel ID="upMenu" runat="server">
        <ContentTemplate>
            <asp:Label Text="" runat="server" ID="lblError" />
            <br />
            <erm:ERMGrid runat="server" AutoGenerateColumns="false" ID="grdMenu" ShowRecordIndex="true"
                DataKeyNames="MenuID" Width="100%" GridStyle="SkyBlue" OnActionClick="grdMenu_ActionClick"
                OnAddNew="grdMenu_AddNew" OnPageIndexChanged="grdMenu_PageIndexChanged" OnRowDataBound="grdMenu_RowDataBound"
                OnRowCommand="grdMenu_RowCommand">
                <Menu VisibleAdd="true" VisibleTotalRecords="true" VisibleDelete="false" />
                <Columns>
                    <asp:TemplateField HeaderText="Title">
                        <ItemTemplate>
                            <span style='<%# Eval("ParentID") == null?"": "padding-left: 25px" %>'>
                                <%# Eval("Title") %>
                            </span>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Url" HeaderText="Url" />
                    <asp:TemplateField HeaderText="Order">
                        <ItemStyle Width="50px" HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:ImageButton runat="server" ID="btnImgUp" ImageUrl="~/Images/Arrow_Up16x16.png"
                                CommandName="Up" CommandArgument='<%# Eval("Order") %>' />
                            <asp:ImageButton runat="server" ID="btnImgDown" ImageUrl="~/Images/Arrow_Down16x16.png"
                                CommandName="Down" CommandArgument='<%# Eval("Order") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <erm:ActionColumn HeaderText="Actions" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px">
                        <Actions>
                            <erm:Action Name="Edit" Text=" Edit " ToolTip="Edit" />
                            <erm:Action Name="Delete" Text=" Delete " ConfirmMessage="Are you sure you want to delete?" />
                            <erm:Action Name="AssignRole" Text=" Assign Role " />
                        </Actions>
                    </erm:ActionColumn>
                </Columns>
            </erm:ERMGrid>
        </ContentTemplate>
    </asp:UpdatePanel>
    <erm:ErmGroupBox ID="pnPage" runat="server" Width="700px" IsModal="true" ModalBehaviorId="bhvPage"
        HeaderText="Menu Information" Style="display: none">
        <ContentTemplate>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <uc1:MenuEdit runat="server" ID="ctlMenuEdit" OnSuccess="ctlMenuEdit_Success" OnFail="ctlMenuEdit_Fail"
                        OnCancel="ctlMenuEdit_Cancel" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
    </erm:ErmGroupBox>
    <asp:HyperLink ID="HyperLink1" runat="server"></asp:HyperLink>
    <ajax:ModalPopupExtender ID="modalMenuPage" runat="server" PopupControlID="pnPage"
        BehaviorID="bhvPage" TargetControlID="HyperLink1" BackgroundCssClass="modalBackground">
    </ajax:ModalPopupExtender>
</asp:Content>
